<template>
	<view>
		<view class="record">
			<image class="pro-img" src="../../static/errorImage.jpg" mode="aspectFill"></image>
			<view class="record-r">
				<view class="record-r-t">
					<view class="record-r-t-l">
						<view class="name">商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称</view>
						<view class="xg">每单限购1份</view>
						<view class="xl">已售131件，剩余999件</view>
					</view>
					<view class="record-r-t-r">
						<text class="myicon myicon-fenxiang"></text>
						<button open-type="share" plain></button>
					</view>
				</view>
				<view class="record-r-b">
					<view class="price">¥99999.00</view>
					<view class="time">距结束03:12:12</view>
				</view>
			</view>
		</view>
		<view class="list">
			<view class="items" v-for="(item,index) in list" :key="index">
				<image src="../../static/missing-face.png" mode="aspectFill"></image>
				<text class="nickname">{{item.name}}}</text>
				<text>买了</text>
				<text class="number">{{item.num}}</text>
				<text>份</text>
				<text class="time">{{item.time}}</text>
			</view>
		</view>
		<uni-load-more :status="isOver?'noMore':'loading'"></uni-load-more>

		<!-- 底部操作菜单 -->
		<view class="page-bottom">
			<navigator url="/pages/index/index" open-type="switchTab" class="p-b-btn">
				<text class="yticon icon-xiatubiao--copy"></text>
				<text>首页</text>
			</navigator>
			<navigator url="/pages/cart/cart" open-type="switchTab" class="p-b-btn">
				<uni-badge text="1" type="error" size="small"></uni-badge>
				<text class="yticon icon-gouwuche"></text>
				<text>购物车</text>
			</navigator>

			<view class="action-btn-group">
				<button type="primary" class=" action-btn no-border buy-now-btn" @tap="nowBuyClick" data-type="0">立即购买</button>
				<button type="primary" class=" action-btn no-border add-cart-btn" @tap="nowBuyClick" data-type="1">加入购物车</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isOver: false,
				list: [{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					},
					{
						name: '用户昵称用户昵称用户昵称用户昵称用户昵称',
						num: '100',
						time: '2020-12-12 12:12:12'
					}
				]

			}
		},
		onLoad(options) {
			console.log('购买记录----onLoad----', optins);
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	/*
		自定义字体图标
	*/
	@font-face {
		font-family: myicon;
		font-weight: normal;
		font-style: normal;
		src: url('//at.alicdn.com/t/font_1325746_bc4gduicvlp.ttf') format('truetype');
		/* ,url('../../static/iconfont.ttf') format('truetype'); */
	}

	.myicon {
		font-family: "myicon" !important;
		font-size: 16px;
		font-style: normal;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	.myicon-fenxiang:before {
		content: "\e620";
	}

	page {
		background-color: #F8F8F8;
	}

	.record {
		width: 100vw;
		background-color: #fff;
		float: left;
		border-bottom: 2rpx solid #F8F6FC;
		border-top: 2rpx solid #F8F6FC;

		.pro-img {
			margin: 30rpx;
			width: 22vw;
			height: 22vw;
			float: left;
			border-radius: 10rpx;
		}

		.record-r {
			width: calc(78vw - 90rpx);
			float: left;
			font-size: 24rpx;
		}

		.record-r-t {
			width: 100%;
			height: calc(22vw * 0.7);
			margin-top: 30rpx;
			float: left;
			margin-bottom: 10rpx;

			.record-r-t-l {
				width: calc(84% - 2rpx);
				height: 100%;
				border-right: 2rpx dashed #C0C4CC;
				float: left;
				padding-right: 20rpx;

				.name {
					color: #303133;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 1;
					overflow: hidden;
					word-break: break-all; //兼容字母
					width: 100%;
					margin-bottom: 10rpx;
				}

				.xg,
				.xl {
					color: #C0C4CC;
					font-size: 22rpx;
				}
			}

			.record-r-t-r {
				width: 15%;
				float: right;
				text-align: right;
				line-height: calc(22vw * 0.7);
				position: relative;

				text {
					color: #FA436A;
					font-weight: bold;
					font-size: 40rpx;
				}

				button {
					position: absolute;
					width: 100%;
					height: 100%;
					top: 0;
					border: none;
				}
			}
		}

		.record-r-b {
			width: 100%;
			float: left;

			view {
				width: 50%;
				float: left;
			}

			.price {
				color: #FA436A;
				font-size: 30rpx;
			}

			.time {
				color: #303133;
				font-size: 24rpx;
				text-align: right;
			}
		}
	}

	uni-load-more {
		width: 100%;
		float: left;
		margin-bottom: 160rpx;
	}

	.list {
		width: calc(100vw - 40rpx);
		margin: 30rpx 20rpx 0;
		border-radius: 20rpx;
		float: left;
		overflow: hidden;

		.items {
			background-color: #fff;
			width: 100%;
			height: 110rpx;
			line-height: 110rpx;
			border-bottom: 2rpx solid #F8F6FC;

			image {
				width: 65rpx;
				height: 65rpx;
				border-radius: 100rpx;
				margin: 22.5rpx 0;
				float: left;
				margin-left: 30rpx;
				margin-right: 20rpx;
			}

			text {
				font-size: 24rpx;
				float: left;
				color: #303133;
			}

			.nickname {
				max-width: 30vw;
				white-space: nowrap;
				overflow: hidden;
				text-overflow: ellipsis;
				word-break: break-all;
				margin-right: 10rpx;
			}

			.number {
				color: #FA436A;
			}

			.time {
				font-size: 20rpx;
				color: #C0C4CC;
				margin-left: 10rpx;
			}
		}
	}

	.page-bottom {
		position: fixed;
		left: 30upx;
		bottom: 30upx;
		z-index: 95;
		display: flex;
		justify-content: center;
		align-items: center;
		width: 690upx;
		height: 100upx;
		background: rgba(255, 255, 255, .9);
		box-shadow: 0 0 20upx 0 rgba(0, 0, 0, .5);
		border-radius: 16upx;

		.p-b-btn {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			font-size: $font-sm;
			color: $font-color-base;
			/* width: 96upx; */
			width: 112upx;
			height: 80upx;
			position: relative;
			
			uni-badge{
				position: absolute;
				right: 0;
				top: -8rpx;
			}

			.yticon {
				font-size: 40upx;
				line-height: 48upx;
				color: $font-color-light;
			}

			&.active,
			&.active .yticon {
				color: $uni-color-primary;
			}

			.icon-fenxiang2 {
				font-size: 42upx;
				transform: translateY(-2upx);
			}

			.icon-shoucang {
				font-size: 46upx;
			}
		}

		.action-btn-group {
			display: flex;
			height: 76upx;
			border-radius: 100px;
			overflow: hidden;
			box-shadow: 0 20upx 40upx -16upx #fa436a;
			box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
			background: linear-gradient(to right, #ffac30, #fa436a, #F56C6C);
			margin-left: 20upx;
			position: relative;

			&:after {
				content: '';
				position: absolute;
				top: 50%;
				right: 50%;
				transform: translateY(-50%);
				height: 28upx;
				width: 0;
				border-right: 1px solid rgba(255, 255, 255, .5);
			}

			.action-btn {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 180upx;
				width: 196upx;
				height: 100%;
				font-size: $font-base;
				padding: 0;
				border-radius: 0;
				background: transparent;
			}
		}
	}
</style>
